package edu.sctu.practice.class02.yangshengyu.assign03.teat02;

import java.lang.*;

/**
 * Created by Cullen on 2015/10/24.
 */
public class ComparableCircle extends Circle implements Comparable {


    public ComparableCircle(double r) {
        this.r = r;
    }


    @Override
    public int compareTo(Object o) {

        if (getArea() > ((ComparableCircle) o).getArea()) {
            return 0;
        } else {
            return 1;
        }
    }

    private double getArea() {
        return r * r * Math.PI;
    }


}
